Skip to content

fix: align agent websocket origin#307

Merged
V3RON merged 1 commit into
mainfrom
fix/agent-websocket-origin
Jun 12, 2026
Merged

fix: align agent websocket origin#307
V3RON merged 1 commit into
mainfrom
fix/agent-websocket-origin

Conversation

@V3RON

@V3RON V3RON commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

What is this?

This PR fixes Rozenite for Agents session startup when React Native rejects debugger WebSocket connections because the Origin header does not match the selected inspector URL. The CLI now defaults local agent traffic to 127.0.0.1, which matches the loopback host Expo returns for local inspector targets.

How does it work?

Agent sessions now derive the debugger WebSocket Origin from target.webSocketDebuggerUrl instead of hardcoding http://localhost:<port>. That keeps the WebSocket URL and Origin host aligned whether Metro returns 127.0.0.1, localhost, or a secure wss target. The session tests cover the 127.0.0.1 origin case that previously failed.

Why is this useful?

React Native is tightening debugger WebSocket origin checks, and Expo already terminates mismatched local origins. Aligning the origin with the selected inspector target lets Rozenite for Agents bootstrap reliably instead of failing with CDP connection closed before bootstrap completed.

Derive debugger WebSocket Origin from the selected inspector URL.

Default local agent connections to 127.0.0.1 so React Native origin checks accept agent sessions.
@V3RON V3RON merged commit 7b00844 into main Jun 12, 2026
4 checks passed
@V3RON V3RON deleted the fix/agent-websocket-origin branch June 12, 2026 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant